package com.idTech;

import scala.languageFeature;



import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.ForgeHooks;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.audio.SoundPool;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemCoal;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.Potion;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;

@Mod(modid = "iDTechModBase", name = "iDTechModBase", version = "0.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class iDTechModBase 
{
	
	public final static Block swordBlock = new SwordBlock(1000).setHardness(90F).setResistance(0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Kiwi:KiwiBlock").setCreativeTab(CreativeTabs.tabBlock);
	public final static ItemSword masterSword = (ItemSword) new MasterSword(5000, EnumToolMaterial.IRON).setUnlocalizedName("Kiwi:MasterSword").setCreativeTab(CreativeTabs.tabCombat);
	public final static Item heartItem = new Heart(5001);
	public static int HeartID = heartItem.itemID;
	public final static Item bomb = new Bomb(5002);
	public final static Item litBomb = new LitBomb(5003);
	
	/*
	static final Achievement heroOfTime = new Achievement(5000, "TheHeroOfTime!", 0, 0, masterSword, null).setSpecial().registerAchievement();
	*/
        @Instance("iDTechModBase")
        public static iDTechModBase instance;     
        @SidedProxy(clientSide="com.idTech.ClientProxy", serverSide="com.idTech.CommonProxy")
        public static CommonProxy proxy;
        
        
        @PreInit
        public void preInit(FMLPreInitializationEvent event)
        {
        	if(FMLCommonHandler.instance().getSide().isClient())
        	{
        	 MinecraftForge.EVENT_BUS.register(new Sounds());
        	}
        }		
        
        @Init
        public void load(FMLInitializationEvent event)
        {
        	//recipes here
        	
        	
        	
        	
        	GameRegistry.registerBlock(swordBlock, "swordBlock");
        	LanguageRegistry.addName(swordBlock, "Cracked Wall");
        	
        	GameRegistry.registerItem(masterSword, "MasterSword");
        	LanguageRegistry.addName(masterSword, "The Master Sword");
        	
        	GameRegistry.registerItem(heartItem, "Heart");
        	LanguageRegistry.addName(heartItem, "Heart");
        	
        	GameRegistry.registerItem(bomb, "Bomb");
        	LanguageRegistry.addName(bomb, "Bomb");
        	
        	
        	EntityRegistry.registerGlobalEntityID(LazerBolt.class, "LazerBolt", EntityRegistry.findGlobalUniqueEntityId());
        	RenderingRegistry.registerEntityRenderingHandler(LazerBolt.class, new RenderSnowball(heartItem));
        	
        	EntityRegistry.registerGlobalEntityID(LazerBolt.class, "BombEntity", EntityRegistry.findGlobalUniqueEntityId());
        	RenderingRegistry.registerEntityRenderingHandler(BombEntity.class, new RenderSnowball(litBomb));
        	
        	
        	/*
        	LanguageRegistry.addName(heroOfTime, "YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY");
        	
        	LanguageRegistry.instance().addStringLocalization("achievement.TheHeroOfTime", "en_US", "Got Time Achieve!");
        	LanguageRegistry.instance().addStringLocalization("achievement.TheHeroOfTime.desc", "en_US", "You built a Time Machine!");
        	*/
        	

        	MinecraftForge.setBlockHarvestLevel(swordBlock, "pickaxe", 9);
        }
        
        //Achievements
        
       
        

		@PostInit 
        public void postInit(FMLPostInitializationEvent event)
        {
        }
}
